﻿@namespace MudBlazor.UnitTests.TestComponents

<MudDataGrid Items="@_items" ReadOnly="false" EditMode="@DataGridEditMode.Inline">
    <Columns>
        <Column T="Model" Field="@nameof(Model.Name)" />
        <Column T="Model" Field="@nameof(Model.Age)" />
        <Column T="Model" Field="@nameof(Model.Hired)">
            <EditTemplate>
                <MudCheckBox T="bool" @bind-Checked="context.Hired" Label="Hired" Required />
            </EditTemplate>
        </Column>
    </Columns>
</MudDataGrid>

@code {
    private IEnumerable<Model> _items = new List<Model>()
    {
        new Model("John", 45, false), 
        new Model("Johanna", 23, true), 
        new Model("Steve", 32, false)
    };

    public class Model
    {
        public string Name { get; set; }
        public int Age { get; set; }
        public bool Hired { get; set; }

        public Model(string name, int age, bool hired)
        {
            this.Name = name;
            this.Age = age;
            this.Hired = hired;
        }

    }
}
